package com.sunnuwell.demo.vo;

import com.sunnuwell.demo.entity.Resource;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

import java.util.List;

/**
 * @program: entry
 * @description: 用户角色实体类
 * @author: Mr.lv
 * @create: 2019-04-28 09:28
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RoleVo {
    @Id
    private String rid;
    // 角色名
    private String name;
    // 拥有权限菜单
    private List<Resource> resources;


    public Boolean volidate () {
        return name != null && resources.size() != 0 && resources != null;
    }

    // 验证id
    public Boolean volidateRid () {
        return rid != null;
    }

}